<!DOCTYPE HTML>
<html lang="zh">
<meta charset="utf-8">
<head>
    <link href="/aityWeb/static/css/font-awesome.css" rel="stylesheet"/>

    <style type="text/css">
        .nav > li:hover .dropdown-menu {display: block;}
    </style>

	<link href="/aityWeb/static/css/bootstrap.min.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/font-awesome.css" rel="stylesheet"/>
	<!-- bootstrap-table 表格插件样式 -->
	<link href="/aityWeb/static/ajax/libs/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"/>
	<link href="/aityWeb/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/animate.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/style.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/checkbox.css" rel="stylesheet"/>
	<link href="/aityWeb/static/ajax/libs/select/select2.css" rel="stylesheet"/>
    <link href="/aityWeb/static/galaxy/css/ry-ui.css" rel="stylesheet"/>
    
    
</head>
<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 select-info" style="padding-top: 10px;">
			<ul class="breadcrumb" style="font-size: 16px;background-color: #f3f3f3;padding: 5px 10px;color: #337ab7;">
			    <li><i class="fa fa-home" aria-hidden="true"></i>&nbsp;&nbsp;<a href="#">首页</a></li>
			    <li class="active"><a href="#">订单管理</a></li>
			</ul>
			<div class="col-sm-12 " style="padding-top: 10px;height: 100%">
				<form id="menu-form">
					<div class="select-list">
						<ul>
							<li>
								俱乐部名称/负责人姓名：<input type="text" id="keyWord"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="customSearch()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
	
			<div class="btn-group hidden-xs" id="toolbar" role="group">
				<button type="button" class="btn btn-primary" onclick="edit();">
                    <span class="glyphicon glyphicon-plus"></span>
                    新增俱乐部
                </button>
                    
                <button type="button" class="btn btn-primary" style="margin-left: 10px;">
                    <span class="glyphicon glyphicon-download"></span>
                    导出excel
                </button>
				
			</div>
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
	</div>
</div>

<script src="/aityWeb/static/js/jquery.min.js"></script>
	<script src="/aityWeb/static/js/bootstrap.min.js"></script>
	<script src="/aityWeb/static/js/echarts.common.min.js"></script>
	
	<!-- bootstrap-table 表格插件 -->
	<script src="/aityWeb/static/ajax/libs/bootstrap-table/bootstrap-table.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js"></script>
	<!-- jquery-validate 表单验证插件 -->
	<script src="/aityWeb/static/ajax/libs/validate/jquery.validate.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/validate/messages_zh.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/validate/jquery.validate.extend.js"></script>
	<!-- jquery-validate 表单树插件 -->
	<script src="/aityWeb/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js"></script>
	<!-- jquery-export 表格导出插件 -->
	<script src="/aityWeb/static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js"></script>
	<script src="/aityWeb/static/ajax/libs/bootstrap-table/extensions/export/tableExport.js"></script>
	<!-- 遮罩层 -->
	<script src="/aityWeb/static/ajax/libs/blockUI/jquery.blockUI.js"></script>
	<script src="/aityWeb/static/ajax/libs/layer/layer.min.js"></script>
	<script src="/aityWeb/static/ajax/libs/layui/layui.js"></script>
	<script src="/aityWeb/static/galaxy/js/common.js?v=2.3.0"></script>
	<script src="/aityWeb/static/galaxy/js/ry-ui.js?v=2.3.0"></script>
	

<script type="text/javascript">
    var prefix = '';
    //调试开关
    var debug_switch = true;
    $(function() {
        dataTableInit();

    });
    function customSearch(text) {
    $("#bootstrap-table").bootstrapTable('refresh');//刷新Table，Bootstrap Table 会自动执行重新查询
}

    function dataTableInit() {
        $("#bootstrap-table").bootstrapTable({
//            url: "/aityWeb/static/json/clubManger/list.json",
//          createUrl: prefix + "/add",
//          updateUrl: prefix + "/edit/{id}",
//          removeUrl: prefix + "/remove",
//          search: false,
            modalName: "俱乐部管理",
 //           url: "http://test.dongqil.com/qyd_dongqil/club/getClub",
            cache: false,
            method: 'post',
            sortable: false, //是否启用排序
            pagination: true, //分页
            pageNumber:1,//初始化加载第一页，默认第一页
            pageSize: 10,
            pageList: [5,10, 25, 50],//可供选择的每页的行数（*）
            singleSelect: false,
//          showColumns: true,  //显示下拉框勾选要显示的列
            locale:"zh-US", //表格汉化
            search: false , //显示搜索框
            sidePagination: "server", //服务端处理分页server client
            //【查询设置】
            /* queryParamsType的默认值为 'limit' ,在默认情况下 传给服务端的参数为：offset,limit,sort
             设置为 ''  在这种情况下传给服务器的参数为：pageSize,pageNo */
            queryParamsType:'',
            queryParams: function queryParams(params) {
                var param = {
                    data:{
                        page: params.pageNumber,
                        rows: params.pageSize,
                        type:"select",
                        name:$("#keyWord").val(),
                        responsiblename:$("#keyWord").val()
                    },
                    checkcode:"",
                    type: 1//0 APP;1 后台
                };
                syslog(JSON.stringify(param));
                return param;

            },
            responseHandler: function(res) {
                return {
                    "total": res.data.total,//总页数
                    "rows": res.data.rows   //数据
                };
            },
            columns: [{
                checkbox: true
            },
                {
                    field : 'id',
                    title : 'ID'
                },
                {
                    field : 'name',
                    title : '俱乐部名称'
                },
                {
                    field : 'responsiblename',
                    title : '负责人'
                },
                {
                    field : 'groupnumber',
                    title : '群号'
                },
                {
                    field : 'remark',
                    title : '说明'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a href="#" onclick="edit('+row.id+')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a href="#" onclick="info('+row.id+')" style="margin-left: 10px;"><i class="fa fa-sticky-note-o"></i>详情</a>');
                        return actions.join('');
                    }
                }]
        })
    }



    function edit(id){
        $.loadInner.updateUrl("/aityWeb/view/clubManger/edit.html?id="+id);
    }

    function  info(id) {
         $.loadInner.updateUrl("/aityWeb/view/clubManger/info.html?id="+id);
    }

    function syslog(strlog){
        if(debug_switch){
            console.log(strlog);
        }
    }

</script>
</body>
</html>

